import service from '@/alova'

// export const useAuthorityListApi = () => {
//   return service.get('/data/menu/authority.json')
// }
//
// export const useMenuListApi = () => {
//   return service.get('/data/menu/list.json')
// }
//
// export const useMenuApi = (id: Number) => {
//   return service.get('/data/menu/1.json')
// }

const menuApi = {
  getTreeList: () => {
    return service.Get('/api/v1/Menu/TreeList')
  },
  getDetail: (id: number) => {
    return service.Get(`/api/v1/Menu/${id}`)
  },
  add: (data: any) => {
    return service.Post('/api/v1/Menu', data)
  },
  update: (id: number, data: any) => {
    return service.Patch(`/api/v1/Menu/${id}`, data)
  },
  del: (id: number) => {
    return service.Delete(`/api/v1/Menu/${id}`)
  }
}

export default menuApi
